package com.atmilan.quartz.model.dto.customs;

import java.util.List;

import com.alibaba.fastjson.annotation.JSONType;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;

import lombok.Data;

/**
 * 接口推送 实体类
 * @author daigb
 *
 */
@Data
@JsonIgnoreProperties(ignoreUnknown = true)
@JSONType(orders = { "sessionID", "payExchangeInfoHead", "payExchangeInfoLists", "serviceTime", "certNo", "signValue" })
public class HgCheckDTO {
    // 海关发起请求时，平台接收的会话ID
    @JsonProperty(value = "sessionID")
	private String sessionID;

    // 支付请求头
    @JsonProperty(value = "payExchangeInfoHead")
	private Head179DTO payExchangeInfoHead;

    // 支付请求体
    @JsonProperty(value = "payExchangeInfoLists")
	private List<Body179DTO> payExchangeInfoLists;

	// 返回时的系统时间 时间戳的字符串
    @JsonProperty(value = "serviceTime")
	private String serviceTime;
	
	// 证书编号
    @JsonProperty(value = "certNo")
	private String certNo;

	// 签名结果值
    @JsonProperty(value = "signValue")
	private String signValue;

	@Data
	@JsonIgnoreProperties(ignoreUnknown = true)
	@JSONType(orders = { "guid", "initalRequest", "initalResponse", "ebpCode", "payCode", "payTransactionId", "totalAmount", "currency", "verDept", "payType", "tradingTime", "note" })
	public static class Head179DTO {
		// 系统唯一序号
	    @JsonProperty(value = "guid")
		private String guid;
		
		// 支付原始请求
	    @JsonProperty(value = "initalRequest")
		private String initalRequest;
		
		// 支付原始响应
	    @JsonProperty(value = "initalResponse")
		private String initalResponse;
		
		// 电商平台代码
	    @JsonProperty(value = "ebpCode")
		private String ebpCode;
		
		// 支付企业代码
	    @JsonProperty(value = "payCode")
		private String payCode;
		
		// 交易流水号 
	    @JsonProperty(value = "payTransactionId")
		private String payTransactionId;
		
		// 交易金额 单位：元
	    @JsonProperty(value = "totalAmount")
		private Double totalAmount;
		
		// 币制  人民币：142
	    @JsonProperty(value = "currency")
		private String currency;
		
		// 验核机构 
	    @JsonProperty(value = "verDept")
		private String verDept;
		
		// 支付类型 
	    @JsonProperty(value = "payType")
		private String payType;
		
		// 交易成功时间
	    @JsonProperty(value = "tradingTime")
		private String tradingTime;
		
		// 备注
	    @JsonProperty(value = "note")
		private String note;
		
	}
	@Data
	@JsonIgnoreProperties(ignoreUnknown = true)
	@JSONType(orders = { "orderNo", "goodsInfo", "recpAccount", "recpCode", "recpName" })
	public static class Body179DTO {
		
		// 订单编号
	    @JsonProperty(value = "orderNo")
		private String orderNo;
		
		// 商品信息
	    @JsonProperty(value = "goodsInfo")
		private List<GoodsInfoDTO> goodsInfo;
		
		// 收款账号
	    @JsonProperty(value = "recpAccount")
		private String recpAccount;
		
		// 收款企业代码
	    @JsonProperty(value = "recpCode")
		private String recpCode;
		
		// 收款企业名称
	    @JsonProperty(value = "recpName")
		private String recpName;
	}
	
	@Data
	@JsonIgnoreProperties(ignoreUnknown = true)
	@JSONType(orders = { "gname", "itemLink" })
	public static class GoodsInfoDTO {
		
		// 商品名称
	    @JsonProperty(value = "gname")
		private String gname;
		
		// 商品展示链接地址
	    @JsonProperty(value = "itemLink")
		private String itemLink;
	}
	
}

